package com.ase.leetcode.recursive;

import java.text.MessageFormat;

/**
 * @author gyhstart
 * @create 2021/4/11 - 20:58
 **/
public class Recursive {
    /**
     * 递归加法
     * @param x
     * @return
     */
    public static int recursiveAdd(int x) {
        if (x == 0) {
            return 0;
        }
        return x + recursiveAdd(x - 1);
    }

    public static void main(String[] args) {
        System.out.println("recursiveAdd(2) = " + recursiveAdd(2));
    }



    public static void renyi(int a){

    }
}
